/**
 * 
 */
package org.swing.utility.common.chars;
import io.netty.buffer.ByteBuf;
/**
 * @author lqnhu
 *
 */
public interface ReadableCharBuf extends CharSequence,
		Comparable<ReadableCharBuf> {
	/**
	 * Consistent across implementations for the same underlying character
	 * string.
	 */
	@Override
	public int hashCode();

	/**
	 * True for any ReadableCharBuf that represents the same underlying
	 * character string.
	 */
	@Override
	public boolean equals(Object obj);

	/** Should perform lexicographical comparison. */
	public int compareTo(ReadableCharBuf o);

	/** A view of the backing Utf8 bytes as represented by a ByteBuf. */
	public ByteBuf toByteBuf();

	// get arbitrary byte from backing byte store
	public byte getByte(int index);

	// number of bytes in backing byte store
	public int getByteLength();

	// start is inclusive, end is exclusive
	public ReadableCharBuf getSubSequenceForByteBounds(int start, int end);
}
